package com.weiwu.weiwustore.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.joda.time.DateTime;

import java.time.LocalDateTime;
import java.util.Date;


/**
 * user
 * 用户表
 */
@Data
@TableName("user")
public class User implements java.io.Serializable{

    @TableId(type = IdType.AUTO)
    /** 用户id */
    private Integer id;

    /** 用户名称 */
    @TableField("uname")
    private String uname;

    /** 角色id */
    @TableField("roleid")
    private Integer roleid;

    /** 用户登录密码（数据库存储的是加密后的） */
    @TableField("pwd")
    private String pwd;

    /** 性别 */
    @TableField("sex")
    private String sex;

    /** 负责仓库，序号表示仓库id */
    @TableField("storeid")
    private Integer storeid;

    /** 入职日期 */
    @TableField("entrydate")
    private Date entryDate;

    /** 邮箱 */
    @TableField("email")
    private String email;

    /** 手机号 */
    @TableField("phone")
    private String phone;

    /** 数据创建时间 */
    private Date createtime;
    /** 数据最新修改时间 */
    private Date updatetime;
    /** 修改版本标识 乐观锁用 */
    @Version
    @TableField("ver")
    private Integer ver;
    /** 逻辑删除标识 默认0  */
    @TableLogic
    @TableField("del")
    private Integer del;
    public User(){}
    public User(String pwd){
        this.pwd=pwd;
    }
    public User(String uname,String phone,String sex,String pwd,Integer id){
        this.uname=uname;
        this.phone=phone;
        this.sex=sex;
        this.pwd=pwd;
        this.id=id;
    }
    public User(Integer id, String uname, Integer roleid, Integer storeid, String sex, Date entryDate, String phone){
        this.uname=uname;
        this.phone=phone;
        this.roleid=roleid;
        this.storeid=storeid;
        this.sex=sex;
        this.id=id;
        this.entryDate=entryDate;
    }
    public User(String uname, String sex, Date entryDate, String phone
    ,String email,String pwd){
        this.uname=uname;
        this.phone=phone;
        this.roleid=roleid;
        this.storeid=storeid;
        this.sex=sex;
        this.entryDate=entryDate;
        this.email=email;
        this.pwd=pwd;
    }
}